# -*- codeing = utf-8 -*-
# @Time: 2023/6/10 11:10
# @Author: caoyi
# @File: goods_page.py
# @Software: PyCharm
from selenium.webdriver.common.by import By

from tests.pages.base_page import BasePage
from tests.pages.goods_add_page import GoodsAddPage


class GoodsListPage(BasePage):
    '''
    商品列表页面,集成父类BasePage用于复用driver
    '''
    def click_goods_add_button(self):
        #         进入商品列表，点击添加按钮
        goods_add_button = '//*[text()="添加"]'
        self.driver.find_element(By.XPATH, goods_add_button).click()
        # 跳转至商品添加页面
        return GoodsAddPage(self.driver)